#include <stdio.h>
typedef struct{
float Realpart;
float Imagepart;
}Complex;
void Create(Complex *C,float x,float y)
{
    C->Realpart=x;
    C->Imagepart=y;
}
float GetReal(Complex C)
{
    return C.Realpart;
}
float GetImag(Complex C)
{
 return C.Imagepart;
}
Complex Add(Complex C1,Complex C2)
{
    Complex sum;
    //Create(&sum,0,0);
    sum.Realpart=C1.Realpart+C2.Realpart;
    sum.Imagepart=C1.Imagepart+C2.Imagepart;
    return sum;
}
Complex Sub(Complex C1,Complex C2)
{
    Complex difference;
    difference.Realpart=C1.Realpart-C2.Realpart;
    difference.Imagepart=C1.Imagepart-C2.Imagepart;
    return difference;
}
int main(){
    Complex c1,c2,result;
    Create(&c1,3.0,4.0);
    Create(&c2,1.0,2.0);
    result=Add(c1,c2);
    printf("sum:%.2f+%.2fi\n",GetReal(result),GetImag(result));
    result=Sub(c1,c2);
    printf("diff:%.2f+%.2fi\n",GetReal(result),GetImag(result));
    return 0;
}


